import Service from "@/api/config";
import axios from "axios";

export async function getPostList(req, url) {
    let resp = []
    await axios.post(
        'http://localhost:8080' + url,
        req,
        {headers: {"Content-Type" : "application/json;charset=UTF-8"}}
    ).then(res => {
        console.log(res)
        resp = res.data
    })
    return resp
}


export async function logicRemove(index, url) {
    let resp = []
    await axios.post(
        'http://localhost:8080' + url,
        {
            id: index
        },
        {headers: {"Content-Type" : "application/json;charset=UTF-8"}}
    ).then(res => {
        console.log(res)
        resp = res.data
    })
    return resp
}

export async function changeStatus(req, url) {
    let resp = [];
    await axios.post(
        'http://localhost:8080' + url,
        req,
        {headers: {"Content-Type" : "application/json;charset=UTF-8"}}
    ).then(res => {
        console.log(res)
        resp = res.data
    })
    return resp
}




